<html>
<head>
<link href="../../../Objects/sofa_white.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div id="contenu">
		
		<center><h3>Creation of a Scene (6/9)</h3></center>
		<center><img src="5_FullObject.png" width="300" name="FullObject" align="middle"></center>
		
		<br><div id="orangeText">Description</div>
        <p>We will now replace the <strong>PlaneForceField</strong> with a true obstacle, modeled with a topology (read from a mesh file), a mechanical object, and some collision models.</p>

		<div id="orangeText">Key points</div>

         <p>To use the Collision Pipeline described <a href="0_FullObject.scn">here</a>, you need to use Collision Models. They describe geometrical primitives which will be involved in the collision detection. To demonstrate the flexibility you can have, we will use at the same time some spheres, triangles, lines and points.<br>
         There will be as many spheres as particules contained in the Topology.</p>
         
         <div id="tutorialAction"><p>Add a new <strong>GNode</strong> to the <strong>root</strong> node, and rename it "Obstacle".</p>
         
         <p>Add a <strong>MeshTopology</strong> component to the <strong>Obstacle</strong> node. Set the <strong>Filename of the mesh</strong> to <strong>mySofaDirectory/Sofa/share/mesh/cube.obj</strong>.</p>
 
         <p>Add a <strong>MechanicalObject</strong> to the <strong>Obstacle</strong> node. Change to the <strong>Transformation</strong> tab, and change the <strong>Scale of the DOFs in 3 dimensions</strong> from <strong>(1 1 1)</strong> to "(40 40 0.1)".</p>

         <p>Add a <strong>TTriangleModel</strong> to the <strong>Obstacle</strong> node. In the <strong>Property 2/3</strong> tab, change the <strong>Default contact stiffness</strong> to 500. Repeat both steps with a <strong>LineModel</strong> and a <strong>PointModel</strong></p>
                 
         <p>Add a <strong>OglModel</strong> component to the <strong>Obstacle</strong> node. In the <strong>Property 2/3</strong> tab, set the <strong>Path to the model</strong> to <strong>/Sofa/share/mesh/cube.obj</strong>. In the <strong>Transformation</strong> tab, change the <strong>Initial Translation of the object</strong> to "(0 0 -10)" and the <strong>Initial Scale of the object</strong> to "(40 40 0.1)".</p>
         

		<div id="orangeText">Results</div>

         <p>Delete the <strong>PlaneForceField</strong>. Run in SOFA and animate.</p></div>
                
         <p>At this point, our deformable object will interact with the floor using spheres placed at each particle. The collision detection does not take correctly into account what we visually see, but the dragon does not pass through the floor.</p>

		<div id="orangeText">Related</div>

        <p>You have several way to modify the collision detection and response.</p>
        <p>Modify the proximity distance to know when two primitives are colliding: open <b>MinProximityIntersection</b> and edit "alarmDistance" and "contactDistance". </p>
        <p>Modify the stiffness of the response: the response is computed using the product of the contactStiffness of the two collision models involved. Open <b>SphereModel</b> and edit this parameter. You can do the same process with the <b>TTriangleModel</b>, <b>LineModel</b>, <b>PointModel</b>.</p>
                
                <br><center><h3><a href="4_FullObject.scn">Previous</a> ____________  <a href="6_FullObject.scn">Next</a></center></h3>
	</div>
</body>
</html>
